/*
package com.no.hq;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.no.hq.mapper.StudentMapper;
import com.no.hq.pojo.Student;
import com.no.hq.pojo.User;
import com.no.hq.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class MyApplicationTest {

    @Autowired
    private UserService userService;

    @Test
    public void queryAll() {
        List<User> userList = userService.queryAll();
        for (User user : userList) {
            System.out.println(user);
        }
    }

    @Test
    public void queryUserByPage() {
        PageHelper.startPage(3, 5);
        List<User> userList = userService.queryAll();
        PageInfo<User> pageInfo = new PageInfo<>(userList);
        for (User user : userList) {
            System.out.println(user);
        }
        System.out.println("当前页记录数：" + pageInfo.getSize());
        System.out.println("当前页的页码：" + pageInfo.getPageNum());
        System.out.println("总页数：" + pageInfo.getPages());
        System.out.println("总记录数：" + pageInfo.getTotal());
        System.out.println("每页记录数：" + pageInfo.getPageSize());
        System.out.println("上一页：" + pageInfo.getPrePage());
        System.out.println("下一页：" + pageInfo.getNextPage());
    }

    @Autowired
    private StudentMapper studentMapper;
    @Test
    public void testStudentMapperSelectAll() {
        List<Student> studentList = studentMapper.selectAll();
        for (Student stu : studentList) {
            System.out.println(stu);
        }
    }

    @Test
    public void testStudentMapperInsertOne() {
        Student student = new Student();
        student.setStuName("郑七").setStuAge(30).setStuSex("男");
        studentMapper.insertOne(student);
    }

    @Test
    public void testStudentMapperUpdateOne() {
        Student student = new Student();
        student.setStuId(7).setStuName("郑 七").setStuAge(20).setStuBirthday(new Date());
        studentMapper.updateOne(student);
    }

    @Test
    public void testStudentMapperDeleteById() {
        studentMapper.deleteById(7);
    }
}
*/
